package com.hzhr.iot.device.convertor.custom;

import com.hzhr.iot.device.convertor.AlarmDataConvertor;
import com.hzhr.iot.device.entity.ext.AlarmDataEntityExt;
import com.hzhr.iot.device.entity.ext.OptionsEntityExt;
import com.hzhr.iot.device.model.alarmData.AlarmDataModel;
import org.springframework.stereotype.Service;

@Service
public class AlarmDataCustomConvertor extends AlarmDataConvertor {
    @Override
    public AlarmDataModel ext2alarmDataModel(AlarmDataEntityExt in) {
        AlarmDataModel result = super.ext2alarmDataModel(in);

        OptionsEntityExt ext1 = in.getAlarmTypeExt();
        if (ext1 != null) {
            result.setAlarmTypeDes(ext1.getDes());
        }

        return result;
    }
}

